const KoaRouter =require('@koa/router')
const router =new KoaRouter()
const checkToken = require('../middlewares/checkToken')

const v= '/api/v3'
const AntU = require('../controllers/antd/user')
const Ti = require('../controllers/antd/title')
const D = require('../controllers/antd/dash')
const O = require('../controllers/antd/order')
router
.post(`${v}/user/login`,AntU.login)
.get(`${v}/user/info`,checkToken,AntU.getUserInfo)
.get(`${v}/user/list`,checkToken,AntU.getList)
.post(`${v}/user/add`,checkToken,AntU.addUser)
.post(`${v}/upload/img`,Ti.getImage)
.get(`${v}/title/cate`,checkToken,Ti.getCates)
.get(`${v}/title/titlelist`,Ti.getTitle)
.post(`${v}/title/add`,checkToken,Ti.addTitle)
.get(`${v}/dash/chart`,D.getAnalyseDate)
.get(`${v}/dash/echart`,D.getEcharts)
.post(`${v}/step/add`,O.addOrder)
.get(`${v}/step/select`,O.getOrder)
.get(`${v}/step/change`,O.ChangeOrder)



module.exports=router
